// 期望传参：lo&ve=love
const data = 'lo&ve=love'
const url = `http://www.baidu.com/images?pic=${encodeURIComponent(data)}`
// 期望结果：{pic: 'lo&ve=love'}

const arr = url.split('?')[1].split('&')
const obj = {}
arr.forEach((item) => {
  const a = item.split('=')
  obj[a[0]] = decodeURIComponent(a[1])
})
console.log(obj)
